import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from "../views/common/layout.vue"
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    redirect: "/login",
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import( '../views/login.vue')
  },
  {
    path:'/register',
    name:'Register',
    component:()=>import('../views/main/register.vue')
  },
  {
    path:'/main',
    name:'Main',
    component:Layout,
    redirect:'/main/course',
    children:[{
      
        path: "/main/course",
        name: "",
        component: () => import("../views/main/course.vue"),
        meta: {
          title: '',
          keepAlive: true,
        }, 
      },
      {
        path:"/main/contain",
        name:"",
        component:()=>import("../views/main/contain.vue"),
        meta: {
          title: '',
          keepAlive: true,
        },
      },
      {
        path: '/manage/course',
        name: 'course manage',
        component: () => import('../views/manage/course'),
        meta: {
          title: 'course manage',
          keepAlive: true
        }
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
